/**
 * 中文输入冲突
 * @param {*} input
 */
export function inputMethodConflict(input) {
  let flag = true;
  input.addEventListener("compositionstart", () => {
    flag = false;
  });
  input.addEventListener("compositionend", () => {
    flag = true;
  });
  input.addEventListener("keydown", (e) => {
    if (flag && e.code == "Enter") {
      e.preventDefault();
      console.log("表单提交触发了！");
    }
  });
}
